﻿{$header}
<div id="main" class="main" >
    <div class="content">
  <h3 class="heading">单证操作--发货单 [ <a href="__URL__">返回列表</a> ]</h3>
<div id="result" class="result none"></div>
 <div id="myTabContent" class="tab-content">
            
    <div class="tab-pane fade in active" id="home">

<form class="form-horizontal well" method='post' id="form1" action="__URL__/update/">
<table cellpadding=3 cellspacing=3 >
<tr>
	<td class="tRight" >发货单号：</td>
	<td class="tLeft" >{$vo.mano}   </td>
</tr>
<tr>
    <td class="tRight" >销售单号：</td>
    <td class="tLeft" >{$vo.order_id|getModelName='Order','mano'}</td>
</tr>
<php>$customer_id = getModelName($vo['order_id'],'Order','customer_id');</php>
<tr>
	<td class="tRight" >客户：</td>
	<td class="tLeft" ><a href="__APP__/Customer/edit/id/{$customer_id}" target="_blank">{$customer_id|getModelName='Customer'} </a></td>
</tr>
<tr>
    <td>地址：</td>
    <td><textarea name="address" class="input-xxlarge" rows="5">{$vo.order_id|getModelName='Order','address'}</textarea>
</td>
</tr>

<tr>
    <td>货值：</td>
    <td><input type="text" name="total" value="{$vo.total}"></td>
</tr>
<tr>
    <td>重量：</td>
    <td><input type="text" name="weight" value="{$vo.weight}"></td>
</tr>
<tr>
    <td>海关申报内容</td>
    <td><textarea class="span12" name="customs_declaration" rows="3">{$vo.customs_declaration}</textarea></td>
</tr>
<tr>
    <td>海关申报价值</td>
    <td><textarea class="span12" name="customs_declared_value" rows="3">{$vo.customs_declared_value}</textarea></td>
</tr>
<tr>
    <td>物流公司：</td>
    <td>{:configList(C('foreignlogi'),$vo['logi_id'],'logi_id')}</td>
</tr>
<tr>
    <td>物流单号：</td>
    <td><input type="text" name="logi_no" value="{$vo.logi_no}"></td>
</tr>
<tr>
    <td>物流跟踪信息：</td>
    <td> <textarea name="information" class="span7" rows=3>{$vo.information}</textarea> </td>
</tr>
<tr>
    <td>备注</td>
    <td><textarea class="span12" name="remark" rows="3">{$vo.remark}</textarea></td>
</tr>
<tr>
	<td class="tRight" >经办人：</td>
	<td class="tLeft" >{:modList('User')} {$vo.create_time|toDate}</td>
</tr>
<tr>
    <td>发货单状态：</td>
    <td>{$vo.status|getConfigVal='shippingStatus'}
        <input type="hidden" name='status' value='2'><!--完成单据-->
    </td>
</tr>
<tr>
	<td></td>
	<td class="center" width="300">
        <input type="hidden" value="{$vo.id}" name="id">
	<button type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> 单证制作完成</button>
	<button type="reset" onclick="javascript:history.back()" class="btn btn-primary offset1"><i class="icon-arrow-left icon-white"></i> 返回</button>
	</td>
</tr>
</table>
</form>
<?php 
    $map['shipping_id'] = $vo['id'];
    $ps = M('Shipping_detail')->where($map)->order('id desc')->findAll(); 
             
 ?>
<table class="table table-bordered table-striped">
    <tr> <td colspan="9" class="heading alert alert-info" >产品信息</td> </tr>
            <tr><th>编号</th><th>销售订单分号</th><th>备注</th> <th>产品中文</th><th>英文名称</th><th>CAS</th><th>数量</th><th>单位</th><th>货值</th><th>运费</th><th>总计</th> <th>订单要求</th><th>增加备注</th> </tr>
            <volist name="ps" id="ca">
                <tr>
                <td>{$ca.id}</td>
                <php>
                    $product = M('Product');
                    $product->getById($ca['product_id']);
                </php>
                <td>{$ca.order_detail_id|getModelName="Order_detail",'mano'}</td>
                <td>{$ca.order_detail_id|getMsgTip}</td>
                <td>{:$product->name}</td>
                <td>{:$product->ename}</td>
                <td>{:$product->cas}</td>
                <td>{$ca.number}</td>
                <td>{$ca.order_detail_id|getModelName='Order_detail','unit_id'|getModelName='Unit'}</td>
                <td>{$ca.total}</td>
                <td>{$ca.logifee}</td>
                <td>{$ca.sum_total}{$ca.order_detail_id|getModelName='Order_detail','order_id'|getModelName='Order','currency'|getConfigVal='Currency'}</td>
                <td>{$ca.shipping_id|getModelName='Shipping','order_id'|getModelName="Order","remark"}</td>
                <td><a class="btn btn-primary" href="__APP__/Message/add/obj_type/Order_detail/depart/单证/obj_id/{$ca.order_detail_id}/return_type/ToDocument/return_id/{$vo.id}"><i class="icon-comment icon-white"></i> 创建备注</a></td>
            </tr>
            </volist>
        </table>
<?php 
    $map = 'shipping_id = '.$vo['id'] ;
    $packages = M('Package')->where($map)->order('id desc')->findAll(); 
            
 ?>
<table class="table table-bordered table-striped">
    <tr> <th colspan=9 class="heading alert alert-info">包装信息</th> </tr>
    <tr><th>编号</th><th>包装类型</th><th>毛重</th> <th>长(CM)</th><th>宽(CM)</th><th>高(CM)</th><th>标签内容</th><th>粗略重量</th></tr>
    <volist name="packages" id="pa">
        <tr>
        <td>{$pa.id}</td>
        <td>{$pa.pack_type|getConfigVal='packtype'}</td>
        <td>{$pa.pack_weight}</td>
        <td>{$pa.length}</td>
        <td>{$pa.width}</td>
        <td>{$pa.height}</td>
        <td>{$pa.pack_desc}</td>
        <td>{$pa.about_net_weight}</td>
    </tr>
    </volist>
</table>
</div>
</div>
</div>
<include file="Public:footer" />
